#include <iostream>
using namespace std;

bool hasAlternatingBits(int n){
	unsigned long long a=n;
	unsigned long long b=(a>>1);
	unsigned long long c=(a^b);
	return !(c&(c+1));
}	

int main(int argc, char *argv[])
{
	int a=4;
	cout<<hasAlternatingBits(a)<<endl;	
	return 0;
}
